package org.sluggard.tangela.tencent;

import java.io.UnsupportedEncodingException;

import org.sluggard.tangela.core.AbstractToken;
import org.sluggard.tangela.core.Container;

import com.mime.qweibo.examples.QWeiboType.ResultType;

public class TencentToken extends AbstractToken {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 9009366155427585620L;
	private static final String NAME = "tencent";
	
	private String accessKey;
	private String accessSecrect;

	@Override
	public void sendMessage(String content) {
		String response;
		response = OAuth.publishMsg(this, content, null, ResultType.ResultType_Json);
		System.out.println("Response from server：");
        System.out.println(response);
       
	}
	
	public static TencentToken getInstence() {
		TencentToken tt = (TencentToken) Container.getToken(NAME);
		if(tt == null) tt = new TencentToken();
		return tt;
	}

	private TencentToken() {
		super();
	}
	
	public void setState(boolean state) {
		this.state = state;
	}

	@Override
	public String getName() {
		return NAME;
	}

	public String getAccessKey() {
		return accessKey;
	}

	public void setAccessKey(String accessKey) {
		this.accessKey = accessKey;
	}

	public String getAccessSecrect() {
		return accessSecrect;
	}

	public void setAccessSecrect(String accessSecrect) {
		this.accessSecrect = accessSecrect;
	}

}
